package com.dj.uphome.web.controller.system;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.dj.common.web.controller.CoreCrudRestController;
import com.dj.core.PathUtil;

/**
 * 
 * 登录控制器
 *
 */
@Controller
@RequestMapping(value = "/admin")
public class AdminController extends CoreCrudRestController {


	/*
	 * 后台登录系统登录页面
	 */
	@RequestMapping(value = "")
	public ModelAndView toLogin() throws Exception {
		ModelAndView mv = this.getModelAndView();
		try {
			//mv.setViewName(PathUtil.getStringByDevice(this.getRequest())+"system/admin/login");
		} catch (Exception e) {
			mv.addObject("exception", e);
			mv.setViewName(defultError);
		}
		return mv;
	}

	/**
	 * 进入tab标签
	 * 
	 * @return
	 */
	@RequestMapping(value = "/tab")
	public String tab() {
		return "system/admin/tab";
	}

	/**
	 * 进入首页后的默认页面
	 * 
	 * @return
	 */
	@RequestMapping(value = "/login_default")
	public ModelAndView homePage() {
		ModelAndView mv = this.getModelAndView();
		try {
			mv.setViewName("system/admin/default");
		} catch (Exception e) {
			mv.addObject("exception", e);
			mv.setViewName(defultError);
		}
		return mv;
	}

	@RequestMapping(value = "/listPage_desktop")
	public ModelAndView listPage_desktop() throws Exception {
		ModelAndView mv = new ModelAndView();
		try {
			mv.setViewName("default");
		} catch (Exception e) {
			mv.addObject("exception", e);
			mv.setViewName(defultError);
		}
		return mv;
	}
}
